package com.summer.Collection.msb;

import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Set;

public class Test05 {
    public static void main(String[] args) {
        HashMap hashMap = new HashMap<String,String>();
        //增加
        hashMap.put("k1","v1");
        hashMap.put("k1","v1");
        hashMap.put("k2","v2");
        System.out.println(hashMap);
        //删除
        hashMap.remove("k1");
        System.out.println(hashMap);
        //修改
        hashMap.put("k1","v11");
        System.out.println(hashMap);
        Set set = hashMap.entrySet();
        System.out.println(set);
        Object k1 = hashMap.get("k1");
        System.out.println(k1);
        hashMap.clear();
        System.out.println(hashMap);
        //linkedhashmap有序
        LinkedHashMap<String, Integer> linkedHashMap = new LinkedHashMap<>();
        linkedHashMap.put("lk1",1);
        linkedHashMap.put("lk2",2);
        linkedHashMap.put("lk3",3);
        linkedHashMap.put("lk1",4);
    }
}
